<template>
    <div>
        <el-descriptions title="供应商信息详情">
            <el-descriptions-item label="供应商名称">{{supplierName}}</el-descriptions-item>
            <el-descriptions-item label="负责人">{{name}}</el-descriptions-item>
            <el-descriptions-item label="负责人电话">{{phone}}</el-descriptions-item>
            <el-descriptions-item label="供应商地址">{{address}}</el-descriptions-item>
            <el-descriptions-item label="经营范围">{{range}}</el-descriptions-item>
        </el-descriptions>

        <el-button @click="ok">确认</el-button>
    </div>
</template>

<script>
    export default {
        name: "FindSupplier",

        data(){
            return {
                supplierName:'佳能成都分销公司',
                name:'赵勇',
                phone:'18100000000',
                address:'江苏省苏州市吴中区吴中大道',
                range:'苏州',
                boss:'',

            }
        },

        mounted() {
            this.changeProviderid()

        },

        methods:{
            changeProviderid(providerid){
                providerid = this.$store.state.providerid
                this.init(providerid)
            },

            init(providerid){

                let url = "api/provider/findById?id="+providerid
                this.$axios.get(url).then(r =>{
                    let obj = r.data
                    console.log(obj)
                    this.supplierName = obj.providername
                    this.name = obj.boss
                    this.phone = obj.phone
                    this.address = obj.address
                    this.range = obj.scope
                })
            },
            ok(){
                this.$router.push("SupplierView")
            }
        }


    }
</script>

<style scoped>

</style>